package com.factory.iamp.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.factory.iamp.pojo.*;
import com.factory.iamp.utils.helper.PageHelper;

import java.util.List;

public interface TableService {
    int Count(int lid);

    int findUnfinishedProblemTableCount();

    int QueryCount(String QueryStr, int lid);

    int CountByProblem(int pid, String QueryStr, String order, int filter);

    int findAssemblyCount(String QueryStr, int lid);

    int findBySellidCount(List<Integer> sid, int lid);

    int PublishCount(int lid);

    int StoreCount(String QueryStr, int lid, int filter);

    int findByNameCount(String name, int lid);

    int findMyCount(String uid, String QueryStr, int lid, int filter);

    int findByCreatorCount(String uid, String QueryStr, int lid, int filter);

    int findByHandlerCount(String uid, String QueryStr, int lid, int filter);

    int findMyPassedTableCount(String uid, String name, List<Integer> typeList, String begin, String end, int lid, int filter);

    int SubTableCount(int tid, int lid);

    int DraftCount(String uid, String QueryStr, int lid);

    List<JSONObject> getDeliveryInspectionData(int range, int line);

    Object getProblemRecordData(int lid);

    JSONArray getCheckStateByName(String QueryStr, String name, int lid);

    List<CheckLog> getTableCheckTime(int tid);

    List<QuestionLog> getTableProblemSign(int tid);

    List<Table> findUnfinishedProblemTableListPaged(PageHelper data, int lid);

    JSONArray getCheckStateByTableList(String QueryStr, int lid);

    JSONObject addAssemblyTable(JSONObject data, int lid);

    TableAssembly alterAssemblyTable(int aid, JSONObject data, int lid);

    TableAssembly copyAssemblyTable(String name, int aid, int lid);

    TableDetail getTableById(int tid, int lid);

    Table passTableToUid(int tid, String uid, String user, int lid);

    Table updatePrecastId(int tid, String precastid, String user, int lid);

    Table updateSellId(int tid, String sellid, String user, int lid);

    List<Table> ListPaged(PageHelper data, int lid);

    List<Table> QueryListPaged(PageHelper data, String QueryStr, int lid);

    List<Table> ListByProblemPaged(PageHelper data, int pid, String QueryStr, String order, int lid, int filter);

    List<TableForStoreList> StoreListPaged(PageHelper data, String QueryStr, String Order, User user, int filter);

    List<TableAssembly> findAssemblyListPaged(PageHelper data, String QueryStr, int lid);

    List<Table> findByNameListPaged(PageHelper data, String name, int lid);

    List<Table> findBySellidListPaged(PageHelper data, List<Integer> sid, int lid);

    List<Table> findMyListPaged(PageHelper data, String uid, String QueryStr, int lid, int filter);

    List<Table> findByCreatorListPaged(PageHelper data, String uid, String QueryStr, int lid, int filter);

    List<Table> findByHandlerListPaged(PageHelper data, String uid, String QueryStr, int lid, int filter);

    List<Table> findMyPassedTableListPaged(
            PageHelper data, String uid, String name, List<Integer> typeList, String begin, String end, int lid, int filter
    );

    List<Table> SubTableListPaged(PageHelper data, int tid, int lid);

    List<Table> DraftListPaged(PageHelper data, String uid, String QueryStr, int lid);

    Table addDraftTable(Table table, int lid);

    Table alterDraftTable(int tid, String uid, JSONObject data, int lid);

    Table alterTable(int tid, String uid, JSONObject data, int lid);

    Table publishDraftTable(int tid, String uid, int lid);

    Table storeDraftTable(int tid, String uid, int lid);

    void setFatherTable(int tid, int ftid);

    Table returnFactory(int tid, String reason, String process, int lid);

    void deleteDraftTable(int tid, String uid, int lid);

    void deleteAssemblyTable(int aid, User user);

    void deleteTableContentSign(int tid, int oid, User user, int type);

    void deleteTableQuestion(int tid, int oid, String uid, int lid);

    void deleteTableQuestionSign(int tid, int oid, String uid, int lid);

    void deleteTableProblemSign(int tid, int oid, String uid, int lid);

    void deleteTable(int tid, User user);

    TableContent fillTableContent(int tid, int oid, String uid, TableContent tableContent, int lid);

    Table fillTableHead(int tid, String uid, String content, int lid);

    TableContent checkTableContent(int tid, int oid, int type, String uid, String img_path, int lid) throws Throwable;

    TableContent addTableContentProblem(
            int tid, int oid, String uid, JSONObject problem, String img_path
    ) throws Throwable;

    void processTableContentProblem(int tid, int oid, String uid, String record, String img_path) throws Throwable;

    Table storeTable(int tid, int lid);

    Table claimTable(int tid, String uid, int lid);

    Table archiveTable(int tid, int lid);

    String makeTableFile(int tid, int lid) throws Throwable;

    JSONObject makeSevenDayData(int range);

    JSONObject makeSevenDayDataLine(int range, int line);
}
